tools/configure: Check if pixman is present on the system when building QEMU
authorJulien Grall <julien.grall@linaro.org>
Thu, 15 Jan 2015 21:06:18 +0000 (21:06 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 19 Jan 2015 16:09:57 +0000 (16:09 +0000)
QEMU upstream requires the use of pixman. When pixman is not present the
system, the configure of QEMU will fail with:

ERROR: pixman not present. Your options:
         (1) Preferred: Install the pixman devel package (any recent
             distro should have packages as Xorg needs pixman too).
         (2) Fetch the pixman submodule, using:
             git submodule update --init pixman

I think we can use by default the version on the system. So check it
a Xen configuration time to avoid a build issue later.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- reran autogen.sh, adjusted comment ]

tools/configure
tools/configure.ac

index 7131d63375af887a01ef02abae426a5f7b1f3b0c..f9f560ad804092907079a63f1d26b81adea8665a 100755 (executable)
@@ -644,6 +644,8 @@ zlib
 FETCHER
 FTP
 WGET
+pixman_LIBS
+pixman_CFLAGS
 glib_LIBS
 glib_CFLAGS
 PKG_CONFIG_LIBDIR
@@ -833,6 +835,8 @@ PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
 glib_CFLAGS
 glib_LIBS
+pixman_CFLAGS
+pixman_LIBS
 LIBNL3_CFLAGS
 LIBNL3_LIBS
 SYSTEMD_CFLAGS
@@ -1548,6 +1552,9 @@ Some influential environment variables:
               path overriding pkg-config's built-in search path
   glib_CFLAGS C compiler flags for glib, overriding pkg-config
   glib_LIBS   linker flags for glib, overriding pkg-config
+  pixman_CFLAGS
+              C compiler flags for pixman, overriding pkg-config
+  pixman_LIBS linker flags for pixman, overriding pkg-config
   LIBNL3_CFLAGS
               C compiler flags for LIBNL3, overriding pkg-config
   LIBNL3_LIBS linker flags for LIBNL3, overriding pkg-config
@@ -7670,6 +7677,97 @@ $as_echo "yes" >&6; }
 
 fi
 
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pixman" >&5
+$as_echo_n "checking for pixman... " >&6; }
+
+if test -n "$pixman_CFLAGS"; then
+    pkg_cv_pixman_CFLAGS="$pixman_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pixman-1\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "pixman-1") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_pixman_CFLAGS=`$PKG_CONFIG --cflags "pixman-1" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$pixman_LIBS"; then
+    pkg_cv_pixman_LIBS="$pixman_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pixman-1\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "pixman-1") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_pixman_LIBS=`$PKG_CONFIG --libs "pixman-1" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               pixman_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pixman-1" 2>&1`
+        else
+               pixman_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pixman-1" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$pixman_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (pixman-1) were not met:
+
+$pixman_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables pixman_CFLAGS
+and pixman_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables pixman_CFLAGS
+and pixman_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+       pixman_CFLAGS=$pkg_cv_pixman_CFLAGS
+       pixman_LIBS=$pkg_cv_pixman_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
 fi
 
 # Extract the first word of "wget", so it can be a program name with args.
index fd405c59049c6a9992a01e2a78ae41649ca19dfe..113285d269d6d8d06cf5e50d65c723bad0158475 100644 (file)
@@ -324,9 +324,10 @@ esac
  AX_CHECK_UUID
  AX_CHECK_CURSES
 
-dnl Glib 2.0 is only required when QEMU is built
+dnl The following are only required when upstream QEMU is built
 AS_IF([test "x$qemu_xen" = "xy"], [
 PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.12])
+PKG_CHECK_MODULES(pixman, pixman-1)
 ])
 AX_CHECK_FETCHER